<#include "header.htm"/>

<#import "../macros/pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>

<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>

<#if logged>
	<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/watch.js?${startupTime}"></script>
</#if>

<#if moderator>
	<script type="text/JavaScript" src="${JForumContext.encodeURL("/js/list/moderation")}"></script>
</#if>

<h2>
      <#if rssEnabled>
		<a href="${JForumContext.encodeURL("/rss/forumTopics/${forum.id}")}"><img src="${contextPath}/templates/${templateName}/img/feed.gif" border="0" alt="[XML]" /></a>
	  </#if>
      <a class="maintitle" href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name?html} </a>						
</h2>

<div class="topic-actions" >

	
	
		<#if !readonly && !replyOnly>
		<div class="buttons">
			<div class="post-icon" title="Post a new topic">
			   <a href="${JForumContext.encodeURL("/jforum${extension}?module=posts&amp;action=insert&amp;forum_id=${forum.id}", "")}" rel="nofollow"><span></span>${I18n.getMessage("PostForm.newPost")}</a>
			</div>
		</div>
		</#if>
	
		<div class="search-box">
	   		<form accept-charset="${encoding}" action="${JForumContext.encodeURL("/jforum")}" method="get" id="formSearch" name="formSearch">
			<fieldset>
			    <input type="hidden" name="module" value="search"/>
				<input type="hidden" name="action" value="search"/>
				<input type="hidden" name="forum" value="${forum.id}">
				<input type="hidden" name="match_type" value="all">
				<input class="inputbox search tiny" type="text" onblur="if (this.value == '') this.value = '${I18n.getMessage("ForumIndex.searchThisForum")}...';" onclick="if (this.value == '${I18n.getMessage("ForumIndex.searchThisForum")}...') this.value = '';" value="${I18n.getMessage("ForumIndex.searchThisForum")}..." size="20" name="search_keywords" />
				<input class="button2" type="submit" value="${I18n.getMessage("ForumBase.search")}" />
			</fieldset>
			</form>
		</div>
		
		<div class="pagination">
		                <#if logged>
							<a href="${JForumContext.encodeURL("/forums/readAll/${forum.id}")}">${I18n.getMessage("ForumIndex.setAllTopicsAsRead")}</a>
						</#if>

						<#if moderator>
                             &nbsp;&bull;&nbsp;
							<#if openModeration?default(false)>
								<#assign link = ""/>
								<#if (start > 0)>
									<#assign link = JForumContext.encodeURL("/forums/show/" + start + "/" + forum.id)/>
								<#else>
									<#assign link = JForumContext.encodeURL("/forums/show/" + forum.id)/>
								</#if>
								<a href="${link}">${I18n.getMessage("Moderation.CloseModeration")}</a>
							<#else>
								<a href="${contextPath}/forums/moderation/<#if (start > 0)>${start}/</#if>${forum.id}${extension}">${I18n.getMessage("Moderation.OpenModeration")}</a>
							</#if>
						</#if>
						
						<#assign paginationData><@pagination.doPagination action, forum.id/></#assign>
						${paginationData}
		    
			
		</div>
		

	</div>
	

			<#if (canApproveMessages && topicsToApprove.size() > 0)>
				<script type="text/javascript">
				<!--
				function viewPending(id)
				{
					var tr = document.getElementById("tr_pending_" + id);
					var d = tr.style.display
					tr.style.display = (d == "none" ? "" : "none");
				}
				-->
				</script>
				<form action="${JForumContext.encodeURL("/jforum")}" method="post" accept-charset="${encoding}">
				<input type="hidden" name="action" value="approveMessages" />
				<input type="hidden" name="module" value="${moduleName}" />
				<input type="hidden" name="forum_id" value="${forum.id}" />
				
				
				
				
<div class="panel bg3">
	<div class="inner"><span class="corners-top"><span></span></span>

	<div style="width: 100%;">


	<div id="cp-main" class="mcp-main">
		

    <h3 id="review">${I18n.getMessage("Moderation.checkQueue")}</h3>

<div id="topicreview" style="height: auto; overflow: visible; max-height: none; width: 100%;">
	

					<#list topicsToApprove.values() as topic>
						<#if topic_index % 2 == 0>
							<#assign rowColor = "post bg2">
						<#else>
							<#assign rowColor = "post bg1">
						</#if>
						<#list topic.posts as post>
						    <#assign post = postFormatter.preparePostForDisplay(post)/>		
                	<div class="${rowColor}">
                		<div class="inner"><span class="corners-top"><span></span></span>
                			<div class="postbody" id="pr44">
                				<div class="right-box">
                					<input type="radio" id="status_approve_${post.id}" name="status_${post.id}" value="aprove" /><label for="status_approve_${post.id}">${I18n.getMessage("Moderation.Admin.aprove")}</label>&nbsp;
									<input type="radio" id="status_defer_${post.id}" name="status_${post.id}" value="defer" checked="checked" /><label for="status_defer_${post.id}">${I18n.getMessage("Moderation.Admin.defer")}</label>&nbsp;
									<input type="radio" id="status_deny_${post.id}" name="status_${post.id}" value="reject" /><label for="status_deny_${post.id}">${I18n.getMessage("Moderation.Admin.reject")}</label>&nbsp;
									<input type="hidden" name="post_id" value="${post.id}" />
				
                				</div>
                				<h3>
               		 				<#if (topic.topicReplies > 0)>
										<a href="${JForumContext.encodeURL("/posts/list/${topic.topicId}")}" class="gen">${topic.topicTitle?html}</a>
									<#else>
										<span class="gen">${topic.topicTitle?html}</span>
									</#if>
                				</h3>
                				<p class="author"><img src="${contextPath}/templates/${templateName}/img/icon_post_target.gif" width="11" height="9" alt="Post" title="Post"></a> ${I18n.getMessage("by")} <strong><a href="${JForumContext.encodeURL("/user/profile/${post.userId}")}">${post.postUsername}</a></strong></p>
                				<div class="content">${post.text}</div>
                			</div>
                			<span class="corners-bottom"><span></span></span>
                		</div>
                	</div>


						
						</#list>
					</#list>
						
</div>
<hr>
		<fieldset class="submit-buttons">
        	<input type="submit" class="button2 display-options" value="${I18n.getMessage("Moderation.Admin.submit")}" />
		</fieldset>
</div>
	<div class="clear"></div>

	</div>
	<span class="corners-bottom"><span></span></span></div>
</div>




				</form>
			</#if>

			<#if moderator>
				<form action="${JForumContext.encodeURL("/jforum")}" method="post" name="formModeration" id="formModeration" accept-charset="${encoding}">
				<input type="hidden" name="action" value="doModeration" />
				<input type="hidden" name="module" value="moderation" />
				<input type="hidden" name="returnUrl" value="${JForumContext.encodeURL("/${moduleName}/${action}/${start}/${forum.id}")}" />
				<input type="hidden" name="forum_id" value="${forum.id}" />
				<input type="hidden" name="log_type" value="0"/>
				<input type="hidden" name="log_description">
			</#if>

		<div class="forumbg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt>${I18n.getMessage("ForumIndex.topics")}</dt>
					<dd class="posts">${I18n.getMessage("ForumIndex.replies")}</dd>
					<dd class="views">${I18n.getMessage("ForumIndex.views")}</dd>
					<dd class="lastpost"><span>${I18n.getMessage("ForumIndex.lastPost")}</span></dd>
					<#if moderator && openModeration?default(false)>
						<dd class="mark"><span>${I18n.getMessage("ForumIndex.mark")}</span></dd>
					</#if>
				</dl>
			</li>
		</ul>
		
		<ul class="topiclist topics">
		<#list topics as topic>
					<#assign class1>class="<@presentation.row1Class topic/>"</#assign>
					<#assign class2>class="<@presentation.row2Class topic/>"</#assign>
					<#assign class3>class="<@presentation.row3Class topic/>"</#assign>

					<#if canApproveMessages>
						<#if topicsToApprove.containsKey(topic.id)>
							<#assign class1 = "class='bg_yellow'"/>
							<#assign class2 = class1/>
							<#assign class3 = class1/>
						</#if>
					</#if>
					<#if topic_index % 2 == 0>
						<#assign rowColor = "bg2">
					<#else>
						<#assign rowColor = "bg1">
					</#if>
		

	

		<li class="row ${rowColor}">
			<dl class="icon <@presentation.folderImage topic/>">
			    
				<dt>
					
					<a class="topictitle" href="${JForumContext.encodeURL("/posts/list/${topic.id}")}">
					<#if topic.vote>${I18n.getMessage("ForumListing.pollLabel")}</#if>
					<#if (topic.title?length == 0)>
						No Subject
					<#else>
						${topic.title?html}
					</#if>
					</a>
					<br />
					<#if topic.hasAttach() && attachmentsEnabled>
					   <img src="${contextPath}/templates/${templateName}/img/icon_topic_attach.gif"/>
					</#if>
					${I18n.getMessage("by")}&nbsp;<a style="color: #AA0000;" class="username-coloured" href="${JForumContext.encodeURL("/user/profile/${topic.postedBy.id}")}">${topic.postedBy.username}</a>
					&raquo;${topic.firstPostTime}
    						<#if topic.paginate>
								<@pagination.littlePostPagination topic.id, postsPerPage, topic.totalReplies/>
							</#if>
				</dt>
				
				
				
				
				
				
				<dd class="posts">${topic.totalReplies} <dfn>${I18n.getMessage("ForumIndex.replies")}</dfn></dd>
				<dd class="views">${topic.totalViews} <dfn>${I18n.getMessage("ForumIndex.views")}</dfn></dd>
				<#if (topic.lastPostTime?length > 0)>
					<dd class="lastpost"><span><dfn>${I18n.getMessage("ForumIndex.lastPost")} </dfn>${I18n.getMessage("by")}&nbsp;
					<a style="color: #AA0000;" class="username-coloured" href="${JForumContext.encodeURL("/user/profile/${topic.lastPostBy.id}")}">${topic.lastPostBy.username}</a>
					<#assign startPage = ""/>
					<#if (topic.totalReplies + 1 > postsPerPage?number)>
						<#assign startPage = ((topic.totalReplies / postsPerPage?number)?int * postsPerPage?number) +"/"/>
					</#if>
					<a href="${JForumContext.encodeURL("/posts/list/${startPage}${topic.id}")}#${topic.lastPostId}"><img src="${contextPath}/templates/${templateName}/img/icon_topic_latest.gif" border="0" alt="[Latest Reply]" /></a>
					<br />
					${topic.lastPostTime}
					</span>
					</dd>
					
				</#if>
				
				<#if moderator && openModeration?default(false)>
					<dd class="mark">
					     <input type="checkbox" name="topic_id" value="${topic.id}"  <#if topic.movedId != 0 && topic.forumId != forum.id>disabled="disabled"</#if>/>
				    </dd>
				</#if>
				
				

			</dl>
		</li>

	
	</#list>
			</ul>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	

			
			<#if moderator></form></#if>	
			



      <fieldset class="display-options">
		
		<@presentation.moderationButtons/>
	</fieldset>




			<div class="topic-actions" >
		<#if !readonly && !replyOnly>
		<div class="buttons">
			<div class="post-icon" title="Post a new topic">
			   <a href="${JForumContext.encodeURL("/jforum${extension}?module=posts&amp;action=insert&amp;forum_id=${forum.id}", "")}" rel="nofollow"><span></span>${I18n.getMessage("PostForm.newPost")}</a>
			</div>
		</div>
		</#if>
		
		<div class="pagination">
		                <#if logged>
							<a href="${JForumContext.encodeURL("/forums/readAll/${forum.id}")}">${I18n.getMessage("ForumIndex.setAllTopicsAsRead")}</a>
						</#if>

						<#if moderator>
                             &nbsp;&bull;&nbsp;
							<#if openModeration?default(false)>
								<#assign link = ""/>
								<#if (start > 0)>
									<#assign link = JForumContext.encodeURL("/forums/show/" + start + "/" + forum.id)/>
								<#else>
									<#assign link = JForumContext.encodeURL("/forums/show/" + forum.id)/>
								</#if>
								<a href="${link}">${I18n.getMessage("Moderation.CloseModeration")}</a>
							<#else>
								<a href="${contextPath}/forums/moderation/<#if (start > 0)>${start}/</#if>${forum.id}${extension}">${I18n.getMessage("Moderation.OpenModeration")}</a>
							</#if>
						</#if>
						
						<#assign paginationData><@pagination.doPagination action, forum.id/></#assign>
						${paginationData}
		    
			
		</div>
		
	</div>
	

                    <@presentation.forumsComboTable/>

	                <#assign moderators = forum.getModeratorList()/>
					<#if (moderators.size() > 0)>
						    <div class="pagination">
							<p>${I18n.getMessage("ForumIndex.forumAdmins")}:
							<b><#list moderators as m>
							<a href="${JForumContext.encodeURL("/user/listGroup/${m.id}")}">${m.name?html}</a>
							</#list></b>
							</p>
							</div>
						
					</#if>






<#include "bottom.htm"/>
